package com.sdcx.agrobank.ui.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.blankj.utilcode.util.SPUtils;
import com.sdcx.agrobank.R;

public class ZHActivity extends AppCompatActivity {

    private ImageView back;
    private EditText jine;
    private LinearLayout zh;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_z_h);
        back = findViewById(R.id.back);
        jine = findViewById(R.id.jine);
        zh = findViewById(R.id.zh);
        String ji = SPUtils.getInstance().getString("jine");
        if (ji.equals("")) {
            jine.setText("0.00");
        }else {
            jine.setText(ji);
        }

        zh.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View arg0, MotionEvent arg1) {
                zh.setFocusable(true);
                // 如果xml文件里面没设置，就需要在这里设置
                zh.setFocusableInTouchMode(true);
                zh.requestFocus();
                jine.setCursorVisible(false);
                SPUtils.getInstance().put("jine",jine.getText().toString());
                return false;
            }
        });

        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }
}